package com.whmall.service.crm.module.company.convert;

import com.whmall.component.common.ObjectConverter;
import com.whmall.service.crm.entity.dto.company.SupplierAccountReqDTO;
import com.whmall.service.crm.module.company.entity.SupplierAccountDO;
import org.springframework.stereotype.Component;

/**
 * @Description TODO
 * @Author yangkuan
 * @Date 2020/8/5 14:25
 **/
@Component
public class SupplierAccountReqDTO2SupplierAccountReqDO  implements ObjectConverter<SupplierAccountReqDTO, SupplierAccountDO> {

    @Override
    public SupplierAccountDO fillProperties(SupplierAccountReqDTO source, SupplierAccountDO dest) {
        if (null == dest) {
            dest = new SupplierAccountDO();
        }

        dest.setId(source.getId());
        dest.setCompanyId(source.getCompanyId());
        dest.setAccountName(source.getAccountName());
        dest.setAccount(source.getAccount());
        dest.setAccountType(source.getAccountType());
        dest.setBankName(source.getBankName());
        dest.setBankCode(source.getBankCode());
        dest.setDefaultAccount(source.getDefaultAccount());
        dest.setIsEnabled(source.getIsEnabled());
        dest.setRemark(source.getRemark());

        return dest;
    }
}
